<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cairo Interaction</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GDK 3 参考手册">
<link rel="up" href="reference.html" title="API参考">
<link rel="prev" href="gdk3-Pango-Interaction.html" title="Pango Interaction">
<link rel="next" href="gdk3-X-Window-System-Interaction.html" title="X Window System Interaction">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk3-Pango-Interaction.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK 3 参考手册</th>
<td><a accesskey="n" href="gdk3-X-Window-System-Interaction.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk3-Cairo-Interaction.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gdk3-Cairo-Interaction.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gdk3-Cairo-Interaction"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk3-Cairo-Interaction.top_of_page"></a>Cairo Interaction</span></h2>
<p>Cairo Interaction — 使用开罗(Cairo)库的支持函数</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gdk3-Cairo-Interaction.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gdk/gdk.h&gt;

<a href="../cairo/cairo-cairo-surface-t.html#cairo-surface-t"><span class="returnvalue">cairo_surface_t</span></a> *   <a class="link" href="gdk3-Cairo-Interaction.html#gdk-window-create-similar-surface" title="gdk_window_create_similar_surface ()">gdk_window_create_similar_surface</a>   (<em class="parameter"><code><a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../cairo/cairo-cairo-surface-t.html#cairo-content-t"><span class="type">cairo_content_t</span></a> content</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> height</code></em>);
<a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="returnvalue">cairo_t</span></a> *           <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-create" title="gdk_cairo_create ()">gdk_cairo_create</a>                    (<em class="parameter"><code><a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-get-clip-rectangle" title="gdk_cairo_get_clip_rectangle ()">gdk_cairo_get_clip_rectangle</a>        (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk3-Points-Rectangles-and-Regions.html#GdkRectangle" title="GdkRectangle"><span class="type">GdkRectangle</span></a> *rect</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-set-source-color" title="gdk_cairo_set_source_color ()">gdk_cairo_set_source_color</a>          (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-set-source-rgba" title="gdk_cairo_set_source_rgba ()">gdk_cairo_set_source_rgba</a>           (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="gdk3-RGBA-Colors.html#GdkRGBA" title="GdkRGBA"><span class="type">GdkRGBA</span></a> *rgba</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-set-source-pixbuf" title="gdk_cairo_set_source_pixbuf ()">gdk_cairo_set_source_pixbuf</a>         (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> pixbuf_x</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> pixbuf_y</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-set-source-window" title="gdk_cairo_set_source_window ()">gdk_cairo_set_source_window</a>         (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> y</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-rectangle" title="gdk_cairo_rectangle ()">gdk_cairo_rectangle</a>                 (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="gdk3-Points-Rectangles-and-Regions.html#GdkRectangle" title="GdkRectangle"><span class="type">GdkRectangle</span></a> *rectangle</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-region" title="gdk_cairo_region ()">gdk_cairo_region</a>                    (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a href="../cairo/cairo-Regions.html#cairo-region-t"><span class="type">cairo_region_t</span></a> *region</code></em>);
<a href="../cairo/cairo-Regions.html#cairo-region-t"><span class="returnvalue">cairo_region_t</span></a> *    <a class="link" href="gdk3-Cairo-Interaction.html#gdk-cairo-region-create-from-surface" title="gdk_cairo_region_create_from_surface ()">gdk_cairo_region_create_from_surface</a>
                                                        (<em class="parameter"><code><a href="../cairo/cairo-cairo-surface-t.html#cairo-surface-t"><span class="type">cairo_surface_t</span></a> *surface</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gdk3-Cairo-Interaction.description"></a><h2>Description</h2>
<p>
Cairo是GDK使用的支持矢量和点阵
的图形库。GTK+ 所有的绘画使用了开罗(Cairo)。
</p>
<p>
GDK没有封装开罗(Cairo) API, 但是允许创建开罗上下文来绘制 <a href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindows</span></a>。另外，
GDK函数允许将 <a href="gdk3-Points-Rectangles-and-Regions.html#GdkRectangle"><span class="type">GdkRectangles</span></a>, <a href="gdk3-RGBA-Colors.html#GdkRGBA"><span class="type">GdkRGBAs</span></a>, <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbufs</span></a> 和 <a href="gdk3-Windows.html#GdkWindow"><span class="type">GdkWindows</span></a> 做为开罗
(Cairo)源来进行绘图操作。
</p>
</div>
<div class="refsect1">
<a name="gdk3-Cairo-Interaction.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="gdk-window-create-similar-surface"></a><h3>gdk_window_create_similar_surface ()</h3>
<pre class="programlisting"><a href="../cairo/cairo-cairo-surface-t.html#cairo-surface-t"><span class="returnvalue">cairo_surface_t</span></a> *   gdk_window_create_similar_surface   (<em class="parameter"><code><a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../cairo/cairo-cairo-surface-t.html#cairo-content-t"><span class="type">cairo_content_t</span></a> content</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> width</code></em>,
                                                         <em class="parameter"><code><span class="type">int</span> height</code></em>);</pre>
<p>
Create a new surface that is as compatible as possible with the
given <em class="parameter"><code>window</code></em>. For example the new surface will have the same
fallback resolution and font options as <em class="parameter"><code>window</code></em>. Generally, the new
surface will also use the same backend as <em class="parameter"><code>window</code></em>, unless that is
not possible for some reason. The type of the returned surface may
be examined with <a href="../cairo/cairo-cairo-surface-t.html#cairo-surface-get-type"><code class="function">cairo_surface_get_type()</code></a>.
</p>
<p>
Initially the surface contents are all 0 (transparent if contents
have transparency, black otherwise.)
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>window to make new surface similar to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>content</code></em> :</span></p></td>
<td>the content for the new surface</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>width</code></em> :</span></p></td>
<td>width of the new surface</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>height</code></em> :</span></p></td>
<td>height of the new surface</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a pointer to the newly allocated surface. The caller
owns the surface and should call <a href="../cairo/cairo-cairo-surface-t.html#cairo-surface-destroy"><code class="function">cairo_surface_destroy()</code></a> when done
with it.
This function always returns a valid pointer, but it will return a
pointer to a "nil" surface if <em class="parameter"><code>other</code></em> is already in an error state
or any other error occurs.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-create"></a><h3>gdk_cairo_create ()</h3>
<pre class="programlisting"><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="returnvalue">cairo_t</span></a> *           gdk_cairo_create                    (<em class="parameter"><code><a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>);</pre>
<p>
Creates a Cairo context for drawing to <em class="parameter"><code>window</code></em>.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
Note that calling <a href="../cairo/cairo-cairo-t.html#cairo-reset-clip"><code class="function">cairo_reset_clip()</code></a> on the resulting <a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> will
produce undefined results, so avoid it at all costs.
</div>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly created Cairo context. Free with
<a href="../cairo/cairo-cairo-t.html#cairo-destroy"><code class="function">cairo_destroy()</code></a> when you are done drawing.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-get-clip-rectangle"></a><h3>gdk_cairo_get_clip_rectangle ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gdk_cairo_get_clip_rectangle        (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk3-Points-Rectangles-and-Regions.html#GdkRectangle" title="GdkRectangle"><span class="type">GdkRectangle</span></a> *rect</code></em>);</pre>
<p>
This is a convenience function around <a href="../cairo/cairo-cairo-t.html#cairo-clip-extents"><code class="function">cairo_clip_extents()</code></a>.
It rounds the clip extents to integer coordinates and returns
a boolean indicating if a clip area exists.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rect</code></em> :</span></p></td>
<td>return location for the clip, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if a clip rectangle exists, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if all of <em class="parameter"><code>cr</code></em> is
clipped and all drawing can be skipped</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-set-source-color"></a><h3>gdk_cairo_set_source_color ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_cairo_set_source_color          (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> *color</code></em>);</pre>
<p>
Sets the specified <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a> as the source color of <em class="parameter"><code>cr</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>color</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Colors.html#GdkColor" title="GdkColor"><span class="type">GdkColor</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-set-source-rgba"></a><h3>gdk_cairo_set_source_rgba ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_cairo_set_source_rgba           (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="gdk3-RGBA-Colors.html#GdkRGBA" title="GdkRGBA"><span class="type">GdkRGBA</span></a> *rgba</code></em>);</pre>
<p>
Sets the specified <a class="link" href="gdk3-RGBA-Colors.html#GdkRGBA" title="GdkRGBA"><span class="type">GdkRGBA</span></a> as the source color of <em class="parameter"><code>cr</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rgba</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-RGBA-Colors.html#GdkRGBA" title="GdkRGBA"><span class="type">GdkRGBA</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-set-source-pixbuf"></a><h3>gdk_cairo_set_source_pixbuf ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_cairo_set_source_pixbuf         (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a> *pixbuf</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> pixbuf_x</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> pixbuf_y</code></em>);</pre>
<p>
Sets the given pixbuf as the source pattern for <em class="parameter"><code>cr</code></em>.
</p>
<p>
The pattern has an extend mode of <a href="../cairo/cairo-cairo-pattern-t.html#CAIRO-EXTEND-NONE:CAPS"><code class="literal">CAIRO_EXTEND_NONE</code></a> and is aligned
so that the origin of <em class="parameter"><code>pixbuf</code></em> is <em class="parameter"><code>pixbuf_x</code></em>, <em class="parameter"><code>pixbuf_y</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf</code></em> :</span></p></td>
<td>a <a href="../gdk-pixbuf/gdk-pixbuf-The-GdkPixbuf-Structure.html#GdkPixbuf"><span class="type">GdkPixbuf</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf_x</code></em> :</span></p></td>
<td>X coordinate of location to place upper left corner of <em class="parameter"><code>pixbuf</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pixbuf_y</code></em> :</span></p></td>
<td>Y coordinate of location to place upper left corner of <em class="parameter"><code>pixbuf</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-set-source-window"></a><h3>gdk_cairo_set_source_window ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_cairo_set_source_window         (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> y</code></em>);</pre>
<p>
Sets the given window as the source pattern for <em class="parameter"><code>cr</code></em>.
</p>
<p>
The pattern has an extend mode of <a href="../cairo/cairo-cairo-pattern-t.html#CAIRO-EXTEND-NONE:CAPS"><code class="literal">CAIRO_EXTEND_NONE</code></a> and is aligned
so that the origin of <em class="parameter"><code>window</code></em> is <em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>. The window contains all its
subwindows when rendering.
</p>
<p>
Note that the contents of <em class="parameter"><code>window</code></em> are undefined outside of the
visible part of <em class="parameter"><code>window</code></em>, so use this function with care.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Windows.html#GdkWindow" title="GdkWindow"><span class="type">GdkWindow</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>X coordinate of location to place upper left corner of <em class="parameter"><code>window</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>Y coordinate of location to place upper left corner of <em class="parameter"><code>window</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.24</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-rectangle"></a><h3>gdk_cairo_rectangle ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_cairo_rectangle                 (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="gdk3-Points-Rectangles-and-Regions.html#GdkRectangle" title="GdkRectangle"><span class="type">GdkRectangle</span></a> *rectangle</code></em>);</pre>
<p>
Adds the given rectangle to the current path of <em class="parameter"><code>cr</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>rectangle</code></em> :</span></p></td>
<td>a <a class="link" href="gdk3-Points-Rectangles-and-Regions.html#GdkRectangle" title="GdkRectangle"><span class="type">GdkRectangle</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-region"></a><h3>gdk_cairo_region ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_cairo_region                    (<em class="parameter"><code><a href="../cairo/cairo-cairo-t.html#cairo-t"><span class="type">cairo_t</span></a> *cr</code></em>,
                                                         <em class="parameter"><code>const <a href="../cairo/cairo-Regions.html#cairo-region-t"><span class="type">cairo_region_t</span></a> *region</code></em>);</pre>
<p>
Adds the given region to the current path of <em class="parameter"><code>cr</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cr</code></em> :</span></p></td>
<td>a cairo context</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>region</code></em> :</span></p></td>
<td>a <a href="../cairo/cairo-Regions.html#cairo-region-t"><span class="type">cairo_region_t</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.8</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-cairo-region-create-from-surface"></a><h3>gdk_cairo_region_create_from_surface ()</h3>
<pre class="programlisting"><a href="../cairo/cairo-Regions.html#cairo-region-t"><span class="returnvalue">cairo_region_t</span></a> *    gdk_cairo_region_create_from_surface
                                                        (<em class="parameter"><code><a href="../cairo/cairo-cairo-surface-t.html#cairo-surface-t"><span class="type">cairo_surface_t</span></a> *surface</code></em>);</pre>
<p>
Creates region that describes covers the area where the given
<em class="parameter"><code>surface</code></em> is more than 50% opaque.
</p>
<p>
This function takes into account device offsets that might be
set with <a href="../cairo/cairo-cairo-surface-t.html#cairo-surface-set-device-offset"><code class="function">cairo_surface_set_device_offset()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
<td>a cairo surface</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a href="../cairo/cairo-Regions.html#cairo-region-t"><span class="type">cairo_region_t</span></a>; must be freed with <a href="../cairo/cairo-Regions.html#cairo-region-destroy"><code class="function">cairo_region_destroy()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>